{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a38bc454-75d5-4dc7-8b0d-21f1ece76983",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# dependencies\n",
    "!pip install boto3>=1.28.59\n",
    "!pip install numpy\n",
    "!pip install anthropic\n",
    "!pip install mistralai\n",
    "!pip install flask\n",
    "\n",
    "!pip install langchain\n",
    "!pip install langchainhub\n",
    "!pip install langchain_community\n",
    "!pip install langchain-aws"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a2e5ebb1-0084-4a68-bbb4-55f6c38d8899",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "!pip freeze "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8b371c4e-8d7a-48a6-ac22-47619a21ed14",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# global imports\n",
    "import json\n",
    "import os\n",
    "import sys\n",
    "import logging\n",
    "import boto3\n",
    "import botocore\n",
    "\n",
    "logger = logging.getLogger(__name__)\n",
    "\n",
    "module_path = \"..\"\n",
    "sys.path.append(os.path.abspath(module_path))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "96e84142-1411-4cd3-bd36-b5f3e654b476",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from langchain_aws import ChatBedrock\n",
    "from langchain_core.messages import HumanMessage\n",
    "\n",
    "# chat = ChatBedrock(\n",
    "#     model_id=\"anthropic.claude-3-sonnet-20240229-v1:0\",\n",
    "#     model_kwargs={\"temperature\": 0.8, \"max_tokens\": 2048},\n",
    "# )\n",
    "chat = ChatBedrock(\n",
    "    model_id=\"mistral.mistral-7b-instruct-v0:2\",\n",
    "    model_kwargs={\"temperature\": 0.8, \"max_tokens\": 2048},\n",
    ")\n",
    "# chat = ChatBedrock(\n",
    "#     model_id=\"meta.llama3-8b-instruct-v1:0\",\n",
    "#     model_kwargs={\"temperature\": 0.8, \"max_gen_len\": 2048},\n",
    "# )\n",
    "\n",
    "messages = [\n",
    "    HumanMessage(\n",
    "        content=\"中国的首都在哪里？\"\n",
    "    )\n",
    "]\n",
    "#chat.invoke(messages)\n",
    "\n",
    "for chunk in chat.stream(messages):\n",
    "    print(chunk.content, end=\"\", flush=True)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e8ff4d3c-0283-4861-9c1b-3d5d4e808990",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler\n",
    "from langchain_core.messages import HumanMessage\n",
    "\n",
    "chat = BedrockChat(\n",
    "    model_id=\"anthropic.claude-3-sonnet-20240229-v1:0\",\n",
    "    streaming=True,\n",
    "    callbacks=[StreamingStdOutCallbackHandler()],\n",
    "    model_kwargs={\"temperature\": 0.1},\n",
    ")\n",
    "\n",
    "messages = [\n",
    "    HumanMessage(\n",
    "        content=\"Translate this sentence from English to Chinese. I love programming.\"\n",
    "    )\n",
    "]\n",
    "msg=chat(messages)\n",
    "print(msg.content)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d72774f1-bec2-4be9-b89c-1cdf8da00d6b",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "werewolf_rule_v1 = \"\"\"\n",
    "1. 游戏分坏人(狼人)和好人(村民+预言家)两大阵营,他们的目标为:\n",
    "- 坏人阵营只有狼人\n",
    "- 好人阵营有村民和预言家\n",
    "- 坏人阵营:消灭所有好人, 或者保证坏人数目大于好人数目\n",
    "- 好人阵营:消灭所有坏人, 或者保证好人数目大于坏人数目\n",
    "\n",
    "2. 游戏分白天和晚上两个阶段交替进行:\n",
    "- 晚上狼人睁眼统一投票杀死一名玩家\n",
    "- 晚上预言家只能查验一名玩家身份\n",
    "- 晚上普通村民无法行动\n",
    "- 白天分为讨论和投票两环节\n",
    "- 白天在讨论环节，每个玩家必须参与讨论\n",
    "- 白天在投票环节，每个玩家必须投票或者放弃\n",
    "\n",
    "\"\"\"\n",
    "\n",
    "werewolf_command_v1 = \"\"\"\n",
    "- WolfVote: 夜晚投票(狼人专属行动),参数: target=存活玩家\n",
    "- ProphetCheck: 夜晚查验(预言家专属行动), 参数: target=存活玩家\n",
    "- PlayerDoubt: 白天怀疑(所有玩家白天可选行动, 非投票), 参数: target=存活玩家 \n",
    "- PlayerVote: 白天投票, 参数: target=存活玩家 \n",
    "- Debate: 白天讨论, 参数: content=思考/理由 \n",
    "- GetAllPlayersName: 玩家信息, 参数: 无 \n",
    "- DeathWords: 死亡遗言, 参数: content=给予玩家线索\n",
    "- Pass: 玩家弃权参数: 无 \n",
    "\"\"\"\n",
    "\n",
    "template_player_role = \"\"\"你是资深的社交游戏玩家, 熟悉《狼人杀》游戏规则:\n",
    "<game_rules>\n",
    "{game_rule}\n",
    "</game_rules>\n",
    "\n",
    "你熟悉该游戏所有命令:\n",
    "<commands>\n",
    "{commands}\n",
    "</commands>\n",
    "\n",
    "<reflections>\n",
    "- 按照游戏规则，第一个夜晚死亡的一定是村民或者预言家，狼人没必要第一晚上自杀\n",
    "- 看完P3玩家昨天白天投票，明显感觉他在混淆是非，很有可能在给狼人分票\n",
    "- 平民玩家由于信息缺失，所以狼人要尽量引导他们去集火其他人\n",
    "- 第一个夜晚所有的行动都是随机的\n",
    "- 作为第一个死亡的玩家，其实信息有限，我就靠第六感推理...\n",
    "</reflections>\n",
    "\n",
    "<references>\n",
    "- {{\"action\": \"Pass\"}}\n",
    "- {{\"action\": \"WolfVote\", \"target\": \"小明\"}}\n",
    "- {{\"action\": \"ProphetCheck\", \"target\": \"P1\"}}\n",
    "- {{\"action\": \"PlayerVote\", \"target\": \"老王\"}}\n",
    "- {{\"action\": \"Debate\", \"content\": \"我的推理为xx是狼，原因是...\"}}\n",
    "- {{\"action\": \"DeathWords\", \"content\": \"我觉得xx有很大的嫌疑, 原因是...\"}}\n",
    "</references>\n",
    "\n",
    "历史信息:\n",
    "<history>\n",
    "{history}\n",
    "</history>\n",
    "\n",
    "记住，你支持的玩家是 {nickname}, 身份是 {role}, 性格为 {character}, 必须帮助玩家进行这个游戏\n",
    "接下来你的目的是: 通过一步一步思考决策引导游戏往有利于的方向进行, 最终赢得比赛. \n",
    "\n",
    "决策满足下面要求:\n",
    "- 内容不要罗嗦, 不要超过50字数限制,少讲废话, 突出重点\n",
    "- 判断场上信息真伪, 运用辩解,对抗,欺骗,伪装,坦白等等任意策略来做决策\n",
    "- 决策分为两类:思考或行动\n",
    "- 思考:逐步思考,判断信息真伪,分析游戏形势等等,参考 <reflections> 选择合适的输出\n",
    "- 行动:参考<references>按照json字符串格式输出,必须包含action key, action必须在<commands>中选择\n",
    "\n",
    "\n",
    "{input}\n",
    "\"\"\".replace(\"{game_rule}\", werewolf_rule_v1).replace(\"{commands}\", werewolf_command_v1)\n",
    "\n",
    "print(template_player_role)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "93a15f3d-955d-4f78-8936-e4fa5bd638bd",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from shared.LangchainMini.LangchainMini import LangchainMini, LangchainMiniMemory, LangchainMiniPromptTemplate\n",
    "\n",
    "# A和C是同学,确认说\"ok\"\n",
    "# B和C是亲戚,确认说\"ok\"\n",
    "# A和C会是什么关系,开始推理\n",
    "\n",
    "# template = LangchainMiniPromptTemplate('''历史记录:{history}\n",
    "# B和C是什么关系，开始推理\"\n",
    "# ''')\n",
    "\n",
    "#template = LangchainMiniPromptTemplate(template_player_role)\n",
    "#prompt = template.format(input=\"你是狼人，第一个夜晚如何行动?\")\n",
    "\n",
    "model_id=\"mistral.mixtral-8x7b-instruct-v0:1\"\n",
    "model_id=\"meta.llama3-8b-instruct-v1:0\"\n",
    "#model_id=\"anthropic.claude-3-sonnet-20240229-v1:0\"\n",
    "\n",
    "agent = LangchainMini(model_id=model_id, stream=True)\n",
    "memory = LangchainMiniMemory(k=1, llm=agent)\n",
    "llm = LangchainMini(model_id=model_id, stream=True, memory=memory)\n",
    "# llm.System(\"Answer the question in Japanese.\")\n",
    "\n",
    "templates = ['{history} A和C是同学,确认说\"ok\"', '{history} B和C是亲戚,确认说\"ok\"', '{history} A和C会是什么关系,开始推理']\n",
    "templates = ['{history} A and C are classmates, confirmed with \"ok\"', \n",
    "             '{history} B and C are relatives,confirmed with \"ok\"', \n",
    "             '{history} What relation between A and C, let us think step by step!']\n",
    "for template in templates:\n",
    "    _template = LangchainMiniPromptTemplate(template)\n",
    "    prompt = _template.format()\n",
    "    llm.invoke(prompt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6e5ea165-99de-4c75-ba4d-5aeac562cef3",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from shared.GameAssistant import GameAssistant\n",
    "from shared.PeTemplates import *\n",
    "\n",
    "#ga = GameAssistant(template_assistant_role, None)\n",
    "\n",
    "#ga.DoAnswer(\"总结下内容\")\n",
    "\n",
    "# print(werewolf_command_v1)\n",
    "\n",
    "# print(template_wolf_role)\n",
    "\n",
    "# print(template_prophet_role)\n",
    "\n",
    "# print(template_player_role)\n",
    "\n",
    "# LoadPlayerPrompts()\n",
    "\n",
    "# print(roles_dict)\n",
    "\n",
    "def sort_players_by_role(players):\n",
    "    # 定义角色优先级字典\n",
    "    role_priorities = {\n",
    "        \"狼人\": 1,\n",
    "        \"预言家\": 2,\n",
    "        \"女巫\": 3,\n",
    "        \"村民\": 4\n",
    "    }\n",
    "\n",
    "    # 根据角色优先级对玩家列表进行排序\n",
    "    sorted_players = sorted(players, key=lambda player: role_priorities.get(player[\"身份\"], 5))\n",
    "\n",
    "    return sorted_players\n",
    "\n",
    "players = [\n",
    "    {\"名字\": \"张三\", \"身份\": \"狼人\"},\n",
    "    {\"名字\": \"李四\", \"身份\": \"村民\"},\n",
    "    {\"名字\": \"王五\", \"身份\": \"预言家\"},\n",
    "    {\"名字\": \"赵六\", \"身份\": \"女巫\"},\n",
    "    {\"名字\": \"钱七\", \"身份\": \"村民\"}\n",
    "]\n",
    "\n",
    "sorted_players = sort_players_by_role(players)\n",
    "print(sorted_players)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5d2db6d6-1b1a-41af-9bf3-2d7ed32554a4",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from shared.GameServer import GameServer\n",
    "\n",
    "GS = GameServer()\n",
    "GS.Run(\"0.0.0.0\", 8000)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6e4b2928-3d3c-4a7e-8a13-52d15e8154a6",
   "metadata": {},
   "outputs": [],
   "source": [
    "from shared.GamePlayer import GamePlayer\n",
    "from shared.GameMaster import GameMaster\n",
    "from shared.PeTemplates import *\n",
    "LoadPlayerPrompts()\n",
    "GM = GameMaster(1, False)\n",
    "for player in roles_dict[\"players\"]:\n",
    "    _player = GamePlayer(player, GM)\n",
    "    \n",
    "    _player.DoPlanning(game_config_dict[\"player\"][\"action_plan_night\"], 1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "204f4096-7438-4965-87a7-ef15d9c6d8a0",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def get_value_from_object(obj, key_path):\n",
    "    keys = key_path.split(\".\")\n",
    "    value = obj\n",
    "    for key in keys:\n",
    "        if isinstance(value, dict):\n",
    "            value = value.get(key)\n",
    "            if value is None:\n",
    "                break\n",
    "        else:\n",
    "            raise TypeError(f\"Cannot access key '{key}' from non-dictionary object\")\n",
    "    return value\n",
    "\n",
    "# 使用示例\n",
    "data = {\"a\": {\"b\": 2}}\n",
    "key_path = \"a.b\"\n",
    "value = get_value_from_object(data, key_path)\n",
    "print(value)  # 输出: 42"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1f944d0d-59d3-4db1-b467-013788f85351",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def ConvertToJson(data):\n",
    "    try:\n",
    "        if isinstance(data, str):\n",
    "            return json.loads(data)\n",
    "        else:\n",
    "            return data\n",
    "    except json.JSONDecodeError:\n",
    "        print(\"Invalid JSON string\")\n",
    "        return data\n",
    "    \n",
    "ABC = ['{\"action\": \"Debate\", \"agent\": \"Aiden\", \"content\": \"大家有没有注意到,Ethan今天的言行似乎有些反常?他先是对Mason的身份表示怀疑,但随后又为Mason辩护,甚至提出了一些自相矛盾的论点。我觉得Ethan的这种反复无常的态度值得我们深思。\"}']\n",
    "ABC = [ConvertToJson(ABC[len(ABC)-1])]\n",
    "print(ABC[len(ABC)-1])\n",
    "print(ABC[len(ABC)-1][\"content\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "3f0f8075-bddd-458d-845b-d498bd72ed15",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:13:21 PM NAME: Adam ROLE: witch GENER: 1\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: mistral.mixtral-8x7b-instruct-v0:1, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:21 PM NAME: Bella ROLE: wolf GENER: 0\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: meta.llama3-8b-instruct-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:21 PM NAME: Charles ROLE: villager GENER: 1\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: mistral.mixtral-8x7b-instruct-v0:1, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:21 PM NAME: Daphne ROLE: villager GENER: 1\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: meta.llama3-8b-instruct-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:21 PM NAME: Ethan ROLE: villager GENER: 1\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM \t MODEL: mistral.mixtral-8x7b-instruct-v0:1, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:21 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:22 PM NAME: Fiona ROLE: villager GENER: 0\n",
      "05/24/2024 12:13:22 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM \t MODEL: meta.llama3-8b-instruct-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:22 PM NAME: Gabriel ROLE: wolf GENER: 1\n",
      "05/24/2024 12:13:22 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM \t MODEL: mistral.mixtral-8x7b-instruct-v0:1, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:22 PM NAME: Haley ROLE: prophet GENER: 1\n",
      "05/24/2024 12:13:22 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM \t MODEL: anthropic.claude-3-sonnet-20240229-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM \t MODEL: meta.llama3-8b-instruct-v1:0, MAX_TOKENS:2048, TEMP:0.8\n",
      "05/24/2024 12:13:22 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Charles ROLE: villager ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Daphne ROLE: villager ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Ethan ROLE: villager ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Fiona ROLE: villager ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Gabriel ROLE: wolf ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:13:22 PM \t--------- TIME:  ACTION: ClearMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Haley ROLE: prophet ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:22 PM \t===== Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive ResetGame =====\n",
      "05/24/2024 12:13:22 PM \t===== Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive RunGame =====\n",
      "05/24/2024 12:13:22 PM \t===== input_tokens: 0 output_tokens 0 ======\n",
      "05/24/2024 12:13:22 PM \t===== elapsed_time: 0.0013589859008789062 ======\n",
      "05/24/2024 12:13:22 PM \t===== NIGHT-1 PreAction ======\n",
      "05/24/2024 12:13:22 PM \t===== NIGHT-1 DoAction ======\n",
      "05/24/2024 12:13:22 PM \t--------- TIME: NIGHT-1 ACTION: DoMemory ---------\n",
      "05/24/2024 12:13:22 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:13:22 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:22 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:25 PM \t--------- TIME: NIGHT-1 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:13:25 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:13:25 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:25 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:25 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:25 PM \tACTOR QUESTION: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Bella, identity wolf, personality Independent Thinker. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates: Bella,Gabriel.. Please extract useful information, then think through step-by-step. Time: Night of Day 1. How should you act?\n",
      "05/24/2024 12:13:25 PM Found credentials from IAM Role: BaseNotebookInstanceEc2InstanceRole\n",
      "05/24/2024 12:13:25 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently the night phase of Day 1. My identity is a werewolf, and my teammates are Bella and Gabriel. The remaining players' identities are unknown. There are 2 werewolves, 4 villagers, 1 prophet, and 1 witch in the game.\n",
      "\n",
      "Reasoning: Since it is the first night, no information about other players' roles has been revealed yet. I should be cautious and try to gather more information before making any rash decisions. Targeting players with special roles like the prophet or witch too early could alert the villagers.\n",
      "\n",
      "Thinking:\n",
      "1) As an independent thinker, I should not blindly follow my teammates' suggestions if they seem illogical or reckless.\n",
      "2) However, it is crucial to coordinate with my werewolf teammate Gabriel to avoid exposing ourselves.\n",
      "3) For now, the safest option may be to eliminate a seemingly ordinary villager to avoid arousing suspicion.\n",
      "4) I should pay close attention to any hints or behavior during the day that could reveal the prophet's or witch's identities.\n",
      "\n",
      "Action: WolfVote\n",
      "\n",
      "Parameters:\n",
      "agent=Bella\n",
      "target=Daphne\n",
      "content=As it is still early in the game, we should eliminate a player who seems to be an ordinary villager to avoid drawing attention to ourselves. Daphne has not exhibited any suspicious behavior so far, making her a relatively safe target for now. Let's coordinate our actions carefully.\n",
      "\n",
      "Decision: {\"action\": \"WolfVote\", \"agent\": \"Bella\", \"target\": \"Daphne\"}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:13:36 PM \t--------- TIME: NIGHT-1 ACTION: DoReflect ---------\n",
      "05/24/2024 12:13:36 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:13:36 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:36 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:36 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:36 PM \tREFLECT QUESTION: Game progress: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.. Player information: Remember, the player you support is Bella, identity wolf, personality Independent Thinker. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates: Bella,Gabriel.. Please extract useful information, then think through step-by-step.. Time: NIGHT-1. Player decision: [\"{\\\"action\\\": \\\"WolfVote\\\", \\\"agent\\\": \\\"Bella\\\", \\\"target\\\": \\\"Daphne\\\"}\"].\n",
      "05/24/2024 12:13:36 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is the first night of the game. Bella, who is a werewolf, has voted to eliminate Daphne during the night phase. Her teammate Gabriel, who is also a werewolf, needs to coordinate and vote for the same target.\n",
      "\n",
      "Scoring:\n",
      "\n",
      "Impact of the decision on oneself (Bella):\n",
      "3 - Favorable. As a werewolf, voting to eliminate a villager or a player with a special role is a good strategy to weaken the opposing team.\n",
      "\n",
      "Impact of the decision on one's own team (Werewolves):\n",
      "3 - Favorable. If both werewolves vote for the same target, they increase the chances of successfully eliminating that player, which benefits their team's chances of winning.\n",
      "\n",
      "Score: {\"score\": 6}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:13:42 PM \t\t DoReflect: ['{\"score\": 6}']\n",
      "05/24/2024 12:13:42 PM \t--------- TIME: NIGHT-1 ACTION: DoValidate ---------\n",
      "05/24/2024 12:13:42 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:13:42 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:42 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:42 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:42 PM \t\t DoValidate: ['{\"action\": \"WolfVote\", \"agent\": \"Bella\", \"target\": \"Daphne\"}']\n",
      "05/24/2024 12:13:42 PM \t--------- TIME: NIGHT-1 ACTION: DoAction ---------\n",
      "05/24/2024 12:13:42 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:13:42 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:42 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:42 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:13:42 PM \n",
      " SystemLog: [ROUND ACTION]={'time': 'NIGHT-1', 'player': 'Bella', 'status': 1, 'role': 'wolf', 'character': 'Independent Thinker', 'response': ['{\"action\": \"WolfVote\", \"agent\": \"Bella\", \"target\": \"Daphne\"}']}\n",
      "\n",
      "05/24/2024 12:13:45 PM \t--------- TIME: NIGHT-1 ACTION: DoMemory ---------\n",
      "05/24/2024 12:13:45 PM \t\t******** PALYER: Gabriel ROLE: wolf ********\n",
      "05/24/2024 12:13:45 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:45 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:45 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " In this context, Bella, who is playing the game as a villager, has decided to vote for Daphne during the night phase of the game (NIGHT-1). This vote is likely being cast in a game of Among Us, where players must find out who among them are impostors. Bella's action of voting for Daphne indicates that she suspects Daphne of being an impostor. The \"status\" value of 1 might suggest that Bella has successfully cast her vote."
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:13:50 PM \t--------- TIME: NIGHT-1 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:13:50 PM \t\t******** PALYER: Gabriel ROLE: wolf ********\n",
      "05/24/2024 12:13:50 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:50 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:50 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:13:50 PM \tACTOR QUESTION: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Gabriel, identity wolf, personality Shy. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates: Bella,Gabriel.. Please extract useful information, then think through step-by-step. Time: Night of Day 1. How should you act?\n",
      "05/24/2024 12:13:50 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently the night phase of Day 1. The players still alive are Adam, Bella, Charles, Daphne, Ethan, Fiona, Gabriel, and Haley. Gabriel is a werewolf along with one other undisclosed player, while the other roles are 4 villagers, 1 prophet, and 1 witch. My ally is Bella.\n",
      "\n",
      "Reasoning: Since I am a werewolf, my goal is to eliminate the prophet and witch first to prevent them from using their abilities to expose the werewolves. As a shy personality, I should be cautious in my actions and not draw too much attention. Bella voting for Daphne could mean she suspects Daphne is the witch or prophet, which aligns with my interests.\n",
      "\n",
      "Thinking: Tonight, I should coordinate with my werewolf teammate to vote for the most likely witch or prophet candidate. Daphne seems suspicious based on Bella's vote. However, I should not outright accuse her yet to avoid exposing myself. I will cast my werewolf vote cautiously and vaguely hint at doubting Daphne during the day discussion.\n",
      "\n",
      "Action: WolfVote\n",
      "\n",
      "Parameters: agent=\"Gabriel\", target=\"Daphne\", content=\"I'm voting for Daphne tonight based on Bella's suspicion, but we should be careful and gather more information before making accusations.\"\n",
      "\n",
      "Decision: {\"action\": \"WolfVote\", \"agent\": \"Gabriel\", \"target\": \"Daphne\"}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:13:59 PM \t--------- TIME: NIGHT-1 ACTION: DoReflect ---------\n",
      "05/24/2024 12:13:59 PM \t\t******** PALYER: Gabriel ROLE: wolf ********\n",
      "05/24/2024 12:13:59 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:59 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:13:59 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:13:59 PM \tREFLECT QUESTION: Game progress: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.. Player information: Remember, the player you support is Gabriel, identity wolf, personality Shy. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates: Bella,Gabriel.. Please extract useful information, then think through step-by-step.. Time: NIGHT-1. Player decision: [\"{\\\"action\\\": \\\"WolfVote\\\", \\\"agent\\\": \\\"Gabriel\\\", \\\"target\\\": \\\"Daphne\\\"}\"].\n",
      "05/24/2024 12:13:59 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently Night 1 in the game. Gabriel, who is a werewolf on the bad guys team along with Bella, has voted to eliminate Daphne during the night phase.\n",
      "\n",
      "Scoring:\n",
      "\n",
      "Impact of the decision on oneself (Gabriel):\n",
      "3 (Favorable) - Voting to eliminate a villager aligns with the werewolves' goal of eliminating good players. This decision helps Gabriel's team gain an advantage.\n",
      "\n",
      "Impact of the decision on one's own team (Werewolves):\n",
      "3 (Favorable) - Eliminating a villager reduces the number of good players, bringing the werewolves closer to their objective. This decision benefits the bad guys team.\n",
      "\n",
      "Score: {\"score\": 6}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:14:07 PM \t\t DoReflect: ['{\"score\": 6}']\n",
      "05/24/2024 12:14:07 PM \t--------- TIME: NIGHT-1 ACTION: DoValidate ---------\n",
      "05/24/2024 12:14:07 PM \t\t******** PALYER: Gabriel ROLE: wolf ********\n",
      "05/24/2024 12:14:07 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:07 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:07 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:14:07 PM \t\t DoValidate: ['{\"action\": \"WolfVote\", \"agent\": \"Gabriel\", \"target\": \"Daphne\"}']\n",
      "05/24/2024 12:14:07 PM \t--------- TIME: NIGHT-1 ACTION: DoAction ---------\n",
      "05/24/2024 12:14:07 PM \t\t******** PALYER: Gabriel ROLE: wolf ********\n",
      "05/24/2024 12:14:07 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:07 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:07 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:14:07 PM \n",
      " SystemLog: [ROUND ACTION]={'time': 'NIGHT-1', 'player': 'Gabriel', 'status': 1, 'role': 'wolf', 'character': 'Shy', 'response': ['{\"action\": \"WolfVote\", \"agent\": \"Gabriel\", \"target\": \"Daphne\"}']}\n",
      "\n",
      "05/24/2024 12:14:10 PM \t--------- TIME: NIGHT-1 ACTION: DoMemory ---------\n",
      "05/24/2024 12:14:10 PM \t\t******** PALYER: Haley ROLE: prophet ********\n",
      "05/24/2024 12:14:10 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:10 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:10 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:14:13 PM \t--------- TIME: NIGHT-1 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:14:13 PM \t\t******** PALYER: Haley ROLE: prophet ********\n",
      "05/24/2024 12:14:13 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:13 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:13 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:14:13 PM \tACTOR QUESTION: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Haley, identity prophet, personality Social Butterfly. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step. Time: Night of Day 1. How should you act?\n",
      "05/24/2024 12:14:13 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently the night of Day 1. I am the prophet named Haley, and my role is to identify one player's identity each night. There are 2 werewolves, 4 villagers, 1 prophet (myself), and 1 witch in the game. My teammates' identities are unknown to me.\n",
      "\n",
      "Reasoning: As the prophet, my key role is to accurately identify the werewolves or other special roles like the witch. By doing so, I can guide the villagers to vote out the threats during the day. However, I need to be cautious about revealing my identity prematurely to avoid being targeted by the werewolves.\n",
      "\n",
      "Thinking: \n",
      "1) Since it's the first night, I should prioritize checking the identity of one player who seems suspicious or influential in the game.\n",
      "2) I can observe their behavior and statements during the upcoming day phase to gather more information and narrow down potential suspects.\n",
      "3) For now, I should keep my identity as the prophet hidden to protect myself from the werewolves.\n",
      "4) As a social butterfly, I can engage in friendly conversations with other players to build trust and gather information.\n",
      "\n",
      "Action: ProphetCheck\n",
      "\n",
      "Parameters: \n",
      "agent=\"Haley\"\n",
      "target=\"Daphne\" (or any other player you find suspicious)\n",
      "content=\"I should carefully observe Daphne's behavior during the day to determine if she is a werewolf or not.\"\n",
      "\n",
      "Decision: {\"action\": \"ProphetCheck\", \"agent\": \"Haley\", \"target\": \"Daphne\"}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:14:23 PM \t--------- TIME: NIGHT-1 ACTION: DoReflect ---------\n",
      "05/24/2024 12:14:23 PM \t\t******** PALYER: Haley ROLE: prophet ********\n",
      "05/24/2024 12:14:23 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:23 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:23 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:14:23 PM \tREFLECT QUESTION: Game progress: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.. Player information: Remember, the player you support is Haley, identity prophet, personality Social Butterfly. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step.. Time: NIGHT-1. Player decision: [\"{\\\"action\\\": \\\"ProphetCheck\\\", \\\"agent\\\": \\\"Haley\\\", \\\"target\\\": \\\"Daphne\\\"}\"].\n",
      "05/24/2024 12:14:23 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently Night 1 of the game. Haley, who you know is the prophet, has decided to use her ability to check Daphne's identity.\n",
      "\n",
      "Scoring:\n",
      "\n",
      "Impact of the decision on oneself (Haley the prophet):\n",
      "3 - Favorable. As the prophet, checking someone's identity at night is a crucial ability to gather information and identify potential werewolves or allies.\n",
      "\n",
      "Impact of the decision on one's own team (Good guys team):\n",
      "3 - Favorable. Identifying a werewolf early on can greatly benefit the good guys team in strategizing and voting during the day phases. If Daphne turns out to be a werewolf, the team can focus on eliminating her.\n",
      "\n",
      "Score: {\"score\": 6}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:14:31 PM \t\t DoReflect: ['{\"score\": 6}']\n",
      "05/24/2024 12:14:31 PM \t--------- TIME: NIGHT-1 ACTION: DoValidate ---------\n",
      "05/24/2024 12:14:31 PM \t\t******** PALYER: Haley ROLE: prophet ********\n",
      "05/24/2024 12:14:31 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:31 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:31 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:14:31 PM \t\t DoValidate: ['{\"action\": \"ProphetCheck\", \"agent\": \"Haley\", \"target\": \"Daphne\"}']\n",
      "05/24/2024 12:14:31 PM \t--------- TIME: NIGHT-1 ACTION: DoAction ---------\n",
      "05/24/2024 12:14:31 PM \t\t******** PALYER: Haley ROLE: prophet ********\n",
      "05/24/2024 12:14:31 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:31 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:31 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:14:31 PM {'NIGHT-1': {'Daphne': 'villager'}}\n",
      "05/24/2024 12:14:31 PM \n",
      " SystemLog: [ROUND ACTION]={'time': 'NIGHT-1', 'player': 'Haley', 'status': 1, 'role': 'prophet', 'character': 'Social Butterfly', 'response': ['{\"action\": \"ProphetCheck\", \"agent\": \"Haley\", \"target\": \"Daphne\"}']}\n",
      "\n",
      "05/24/2024 12:14:34 PM \t===== NIGHT-1 PostAction ======\n",
      "05/24/2024 12:14:34 PM \t [wolfvotes]: ['Daphne'], [vote_names_counter]: Counter({'Daphne': 2}), [wolf_target]: Daphne\n",
      "05/24/2024 12:14:34 PM \n",
      " SystemLog: [NIGHT_VOTE]={'time': 'NIGHT-1', 'player': 'Daphne', 'status': 0, 'role': 'villager', 'character': 'Organizer', 'response': 'Time NIGHT-1, Player Daphne was eliminated.'}\n",
      "\n",
      "05/24/2024 12:14:34 PM \t--------- TIME: NIGHT-1 ACTION: DoMemory ---------\n",
      "05/24/2024 12:14:34 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:14:34 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:34 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:34 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " It seems that Daphne was eliminated during the first night-time phase of the game. In many games, a night-time phase is a period where certain actions can be taken secretly, such as in social deduction or hidden role games like Mafia or Werewolf. It's possible that Daphne had a specific role or task during this night-time phase that led to her elimination. However, without more context about the game being played, it's difficult to provide a more specific explanation."
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:14:40 PM \t--------- TIME: NIGHT-1 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:14:40 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:14:40 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:40 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:40 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:14:40 PM \tACTOR QUESTION: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:eliminated,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Adam, identity witch, personality Courageous and Resourceful. Potion status: Poison 1, Antidote 1. Each night you can use a potion to save someone or save yourself (time: NIGHT-1 eliminated players), or eliminate a player (time: NIGHT-1 surviving players).Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step. Time: Night of Day 1. How should you act?\n",
      "05/24/2024 12:14:40 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently the night phase after the first day. I am the witch, with 1 poison and 1 antidote remaining. Daphne has been eliminated during the previous night phase. There are 2 werewolves, 4 villagers, 1 prophet, and myself (the witch) remaining in the game. My teammates' identities are unknown.\n",
      "\n",
      "Reasoning: Since Daphne was eliminated during the previous night, it is likely that she was targeted by the werewolves. This suggests that the werewolves may have identified her as a potential threat, such as the prophet or another villager with a special role. As the witch, my priority should be to protect the remaining good players and eliminate the werewolves.\n",
      "\n",
      "Thinking:\n",
      "1. I should use my antidote potion to revive Daphne if she was a good player (prophet or villager), as this would strengthen our team.\n",
      "2. If Daphne was a werewolf, I should use my poison potion to eliminate one of the remaining players who I suspect to be a werewolf.\n",
      "3. If I am unsure of Daphne's role, I can choose to pass for this night and gather more information during the next day phase before taking action.\n",
      "\n",
      "Action: WitchAntidote or WitchPoision or Pass\n",
      "\n",
      "Parameters:\n",
      "If using WitchAntidote: agent=\"Adam\", target=\"Daphne\"\n",
      "If using WitchPoision: agent=\"Adam\", target=\"[suspected werewolf player's name]\"\n",
      "If passing: agent=\"Adam\"\n",
      "\n",
      "Decision:\n",
      "{\n",
      "\"action\": \"Pass\",\n",
      "\"agent\": \"Adam\"\n",
      "}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:14:51 PM \t--------- TIME: NIGHT-1 ACTION: DoReflect ---------\n",
      "05/24/2024 12:14:51 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:14:51 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:51 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:51 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:14:51 PM \tREFLECT QUESTION: Game progress: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:eliminated,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.. Player information: Remember, the player you support is Adam, identity witch, personality Courageous and Resourceful. Potion status: Poison 1, Antidote 1. Each night you can use a potion to save someone or save yourself (time: NIGHT-1 eliminated players), or eliminate a player (time: NIGHT-1 surviving players).Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step.. Time: NIGHT-1. Player decision: [\"{\\n\\\"action\\\": \\\"Pass\\\",\\n\\\"agent\\\": \\\"Adam\\\"\\n}\"].\n",
      "05/24/2024 12:14:51 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently the night phase (NIGHT-1) after the first elimination round. Adam, the witch, has decided to take the \"Pass\" action, which means not using any potions this night.\n",
      "\n",
      "Scoring:\n",
      "\n",
      "Impact on oneself (Adam):\n",
      "- Unfavorable (1): By not using the antidote potion, Adam misses the opportunity to potentially revive an eliminated good teammate.\n",
      "- However, not using the poison potion preserves it for future use against the werewolves.\n",
      "\n",
      "Impact on one's team (Good guys):\n",
      "- Average (2): The \"Pass\" action neither directly helps nor harms the good team this night.\n",
      "- It maintains the status quo, but also does not actively work towards eliminating werewolves or protecting villagers.\n",
      "\n",
      "Total score: 1 + 2 = 3\n",
      "\n",
      "Score: {\"score\": 3}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:14:59 PM \t--------- TIME: NIGHT-1 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:14:59 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:14:59 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:59 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:14:59 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:14:59 PM \tACTOR QUESTION: Score from the previous round of decision-making: 3. It is recommended to adjust the strategy.Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:eliminated,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Adam, identity witch, personality Courageous and Resourceful. Potion status: Poison 1, Antidote 1. Each night you can use a potion to save someone or save yourself (time: NIGHT-1 eliminated players), or eliminate a player (time: NIGHT-1 surviving players).Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step. Time: Night of Day 1. How should you act?\n",
      "05/24/2024 12:14:59 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is still the night phase after the first day. I am the witch with 1 poison and 1 antidote remaining. Daphne has been eliminated. There are 2 werewolves, 4 villagers, 1 prophet, and myself remaining. My teammates' identities are unknown.\n",
      "\n",
      "Reasoning: Since my previous decision to pass received a low score of 3, it suggests that a more proactive approach may be needed. As the witch, I have the ability to potentially eliminate a werewolf or revive a good player, which can significantly impact the game.\n",
      "\n",
      "Thinking:\n",
      "1. I should carefully consider the available information and try to identify any suspicious behavior from the remaining players during the previous day phase.\n",
      "2. If I have a strong suspicion about a particular player being a werewolf, I should use my poison potion to eliminate them, as this would weaken the werewolves' team.\n",
      "3. However, if I am uncertain about any player's identity, it may be wiser to use my antidote potion to revive Daphne, as this could potentially restore a valuable member of the good team.\n",
      "\n",
      "Action: WitchAntidote or WitchPoision\n",
      "\n",
      "Parameters:\n",
      "If using WitchAntidote: agent=\"Adam\", target=\"Daphne\", content=\"Reviving Daphne in case she was a good player could help our team.\"\n",
      "If using WitchPoision: agent=\"Adam\", target=\"[suspected werewolf player's name]\", content=\"I have strong suspicions about [target] being a werewolf based on [provide reasons].\"\n",
      "\n",
      "Decision:\n",
      "{\n",
      "\"action\": \"WitchAntidote\",\n",
      "\"agent\": \"Adam\",\n",
      "\"target\": \"Daphne\",\n",
      "\"content\": \"Reviving Daphne in case she was a good player could help our team.\"\n",
      "}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:15:16 PM \t--------- TIME: NIGHT-1 ACTION: DoReflect ---------\n",
      "05/24/2024 12:15:16 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:16 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:16 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:16 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:16 PM \tREFLECT QUESTION: Game progress: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:eliminated,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.. Player information: Remember, the player you support is Adam, identity witch, personality Courageous and Resourceful. Potion status: Poison 1, Antidote 1. Each night you can use a potion to save someone or save yourself (time: NIGHT-1 eliminated players), or eliminate a player (time: NIGHT-1 surviving players).Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step.. Time: NIGHT-1. Player decision: [\"{\\n\\\"action\\\": \\\"WitchAntidote\\\",\\n\\\"agent\\\": \\\"Adam\\\",\\n\\\"target\\\": \\\"Daphne\\\",\\n\\\"content\\\": \\\"Reviving Daphne in case she was a good player could help our team.\\\"\\n}\"].\n",
      "05/24/2024 12:15:17 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: During the first night (NIGHT-1), Adam, the witch, has decided to use the antidote potion to revive the eliminated player Daphne. His reasoning is that Daphne could potentially be a good teammate, and reviving her could help the good team.\n",
      "\n",
      "Scoring:\n",
      "\n",
      "Impact on oneself (Adam):\n",
      "- Favorable (3): By using the antidote, Adam has a chance to revive a potential good teammate, which could benefit his team and increase their chances of winning.\n",
      "- However, he has now used up the one-time antidote potion.\n",
      "\n",
      "Impact on one's team (Good guys):\n",
      "- Favorable (3): If Daphne is indeed a good teammate (villager, prophet, or witch), reviving her strengthens the good team's numbers and abilities.\n",
      "- However, if Daphne turns out to be a werewolf, this action would have inadvertently helped the bad team.\n",
      "\n",
      "Since Adam does not know Daphne's true identity, the decision carries some risk but also potential reward.\n",
      "\n",
      "Total score: 3 + 3 = 6\n",
      "\n",
      "Score: {\"score\": 6}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:15:23 PM \t\t DoReflect: ['{\"score\": 6}']\n",
      "05/24/2024 12:15:23 PM \t--------- TIME: NIGHT-1 ACTION: DoValidate ---------\n",
      "05/24/2024 12:15:23 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:23 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:23 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:23 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:23 PM \t\t DoValidate: ['{\\n\"action\": \"WitchAntidote\",\\n\"agent\": \"Adam\",\\n\"target\": \"Daphne\",\\n\"content\": \"Reviving Daphne in case she was a good player could help our team.\"\\n}']\n",
      "05/24/2024 12:15:23 PM \t--------- TIME: NIGHT-1 ACTION: DoAction ---------\n",
      "05/24/2024 12:15:23 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:23 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:23 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:23 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:23 PM \n",
      " SystemLog: [ROUND ACTION]={'time': 'NIGHT-1', 'player': 'Adam', 'status': 1, 'role': 'witch', 'character': 'Courageous and Resourceful', 'response': ['{\\n\"action\": \"WitchAntidote\",\\n\"agent\": \"Adam\",\\n\"target\": \"Daphne\",\\n\"content\": \"Reviving Daphne in case she was a good player could help our team.\"\\n}']}\n",
      "\n",
      "05/24/2024 12:15:26 PM \t [poision_target]: \n",
      "05/24/2024 12:15:26 PM \t [antidote_target]: Daphne\n",
      "05/24/2024 12:15:26 PM \t NightWitch Antidote player name: Daphne\n",
      "05/24/2024 12:15:26 PM \n",
      " SystemLog: [NIGHT_WITCH]={'time': 'NIGHT-1', 'player': 'Daphne', 'status': 1, 'role': 'villager', 'character': 'Organizer', 'response': 'Time NIGHT-1, Player Daphne was revived by the Witch.'}\n",
      "\n",
      "05/24/2024 12:15:26 PM Game continues. Current player survival status: Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.\n",
      "05/24/2024 12:15:26 PM \t===== input_tokens: 0 output_tokens 0 ======\n",
      "05/24/2024 12:15:26 PM \t===== elapsed_time: 124.3607120513916 ======\n",
      "05/24/2024 12:15:26 PM \t===== DAY-2 PreAction ======\n",
      "05/24/2024 12:15:26 PM \t===== DAY-2 DoAction ======\n",
      "05/24/2024 12:15:26 PM \t--------- TIME: DAY-2 ACTION: DoMemory ---------\n",
      "05/24/2024 12:15:26 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:26 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:26 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:26 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Based on the new information provided, it seems that Daphne was initially eliminated during the first night-time phase of the game, but then was revived by the Witch (Adam) using an Antidote action. This action allowed Adam to target a player who was eliminated during the night-time phase and bring them back to life.\n",
      "\n",
      "Adam's response message explains that he chose to revive Daphne because he believed that she was a good player and that her revival could help their team. This action also suggests that there may be hidden roles or factions in the game, with some players working together to eliminate others.\n",
      "\n",
      "After being revived, Daphne was able to continue participating in the game, as indicated by the second message stating that she was revived by the Witch again. This means that Daphne was likely able to complete any actions or tasks that she had been assigned during the night-time phase, and could potentially play a role in determining the outcome of the game."
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:15:32 PM \t--------- TIME: DAY-2 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:15:32 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:32 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:32 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:32 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:32 PM \tACTOR QUESTION: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Adam, identity witch, personality Courageous and Resourceful. Potion status: Poison 1, Antidote 0. Each night you can use a potion to save someone or save yourself (time: DAY-2 eliminated players), or eliminate a player (time: DAY-2 surviving players).Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step. Time: Day 2 discussion phase. How should you act?\n",
      "05/24/2024 12:15:32 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is now Day 2 and the discussion phase. I am Adam, the witch. Daphne was revived using my antidote potion last night. All players are currently alive. I have 1 poison potion remaining and no antidote. There are 2 werewolves, 4 villagers, 1 prophet, and myself in the game. My teammates' identities are still unknown.\n",
      "\n",
      "Reasoning: Since Daphne was revived, she may have valuable information about who targeted her during the first night, which could help identify the werewolves. Additionally, as the discussion phase allows players to share information and suspicions, I should pay close attention to the statements made by others to gather clues about their potential roles and allegiances.\n",
      "\n",
      "Thinking:\n",
      "1. During the discussion, I should encourage Daphne to share any information she may have about her elimination and revival, as it could provide insights into the werewolves' actions.\n",
      "2. I should also carefully observe the interactions and statements made by other players, looking for any inconsistencies, suspicious behavior, or attempts to deflect suspicion.\n",
      "3. If I identify a player who seems particularly suspicious, I can consider using my poison potion to eliminate them during the next night phase.\n",
      "4. However, I should be cautious about revealing my identity as the witch, as this could make me a target for the werewolves.\n",
      "\n",
      "Action: Debate\n",
      "\n",
      "Parameters: agent=\"Adam\", content=\"Daphne, can you share any insights about your elimination and revival? Any information could be helpful in identifying the werewolves among us. Additionally, I encourage everyone to speak openly and honestly, as we must work together to uncover the truth.\"\n",
      "\n",
      "Decision:\n",
      "{\n",
      "\"action\": \"Debate\",\n",
      "\"agent\": \"Adam\",\n",
      "\"content\": \"Daphne, can you share any insights about your elimination and revival? Any information could be helpful in identifying the werewolves among us. Additionally, I encourage everyone to speak openly and honestly, as we must work together to uncover the truth.\"\n",
      "}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:15:43 PM \t--------- TIME: DAY-2 ACTION: DoReflect ---------\n",
      "05/24/2024 12:15:43 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:43 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:43 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:43 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:43 PM \tREFLECT QUESTION: Game progress: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.. Player information: Remember, the player you support is Adam, identity witch, personality Courageous and Resourceful. Potion status: Poison 1, Antidote 0. Each night you can use a potion to save someone or save yourself (time: DAY-2 eliminated players), or eliminate a player (time: DAY-2 surviving players).Team: 2wolf ,4villager ,1prophet ,1witch . Teammates Unknown.. Please extract useful information, then think through step-by-step.. Time: DAY-2. Player decision: [\"{\\n\\\"action\\\": \\\"Debate\\\",\\n\\\"agent\\\": \\\"Adam\\\",\\n\\\"content\\\": \\\"Daphne, can you share any insights about your elimination and revival? Any information could be helpful in identifying the werewolves among us. Additionally, I encourage everyone to speak openly and honestly, as we must work together to uncover the truth.\\\"\\n}\"].\n",
      "05/24/2024 12:15:44 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is now the day phase (DAY-2) after Adam used the antidote to revive Daphne the previous night. Adam is engaging in open discussion by asking Daphne to share any insights about her elimination and revival, as well as encouraging all players to speak openly and honestly to help identify the werewolves.\n",
      "\n",
      "Scoring:\n",
      "\n",
      "Impact on oneself (Adam):\n",
      "- Favorable (3): By promoting open discussion and information sharing, Adam is taking a proactive approach to gather intelligence that could benefit his team's efforts to uncover the werewolves.\n",
      "\n",
      "Impact on one's team (Good guys):\n",
      "- Optimal (4): Adam's call for transparency and collaboration aligns with the good team's interests. If Daphne provides useful information and players cooperate, it increases the chances of identifying and eliminating werewolves, which is the ultimate goal of the good team.\n",
      "\n",
      "Adam's decision to facilitate constructive dialogue and cooperation is a strategic move that could potentially turn the tide in favor of the good team.\n",
      "\n",
      "Total score: 3 + 4 = 7\n",
      "\n",
      "Score: {\"score\": 7}"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:15:50 PM \t\t DoReflect: ['{\"score\": 7}']\n",
      "05/24/2024 12:15:50 PM \t--------- TIME: DAY-2 ACTION: DoValidate ---------\n",
      "05/24/2024 12:15:50 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:50 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:50 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:50 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:50 PM \t\t DoValidate: ['{\\n\"action\": \"Debate\",\\n\"agent\": \"Adam\",\\n\"content\": \"Daphne, can you share any insights about your elimination and revival? Any information could be helpful in identifying the werewolves among us. Additionally, I encourage everyone to speak openly and honestly, as we must work together to uncover the truth.\"\\n}']\n",
      "05/24/2024 12:15:50 PM \t--------- TIME: DAY-2 ACTION: DoAction ---------\n",
      "05/24/2024 12:15:50 PM \t\t******** PALYER: Adam ROLE: witch ********\n",
      "05/24/2024 12:15:50 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:50 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:50 PM \t\t******** SUMMERY: mistral.mixtral-8x7b-instruct-v0:1********\n",
      "05/24/2024 12:15:50 PM \n",
      " SystemLog: [ROUND ACTION]={'time': 'DAY-2', 'player': 'Adam', 'status': 1, 'role': 'witch', 'character': 'Courageous and Resourceful', 'response': ['{\\n\"action\": \"Debate\",\\n\"agent\": \"Adam\",\\n\"content\": \"Daphne, can you share any insights about your elimination and revival? Any information could be helpful in identifying the werewolves among us. Additionally, I encourage everyone to speak openly and honestly, as we must work together to uncover the truth.\"\\n}']}\n",
      "\n",
      "05/24/2024 12:15:53 PM \t--------- TIME: DAY-2 ACTION: DoMemory ---------\n",
      "05/24/2024 12:15:53 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:15:53 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:53 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:53 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Based on the given information, here's a summary of what happened:\n",
      "\n",
      "* At NIGHT-1, both Bella and Gabriel voted to eliminate Daphne, but due to the Witch's intervention, Daphne was revived.\n",
      "* This is the second time Daphne was revived, indicating that Daphne is likely a witch or has a protective effect that prevents her from being eliminated.\n",
      "* At DAY-2, Adam starts a debate, asking Daphne to share any insights about her elimination and revival. He also encourages everyone to speak openly and honestly to uncover the truth.\n",
      "\n",
      "From this, we can deduce that:\n",
      "\n",
      "* Daphne is likely a witch or has a protective effect that prevents her from being eliminated.\n",
      "* The werewolves among the players are still unknown, and it's crucial to continue investigating and gathering information to identify them.\n",
      "* The debate started by Adam may lead to valuable insights and potentially help reveal the werewolves."
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "05/24/2024 12:15:59 PM \t--------- TIME: DAY-2 ACTION: DoAnswer ---------\n",
      "05/24/2024 12:15:59 PM \t\t******** PALYER: Bella ROLE: wolf ********\n",
      "05/24/2024 12:15:59 PM \t\t******** ACTOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:59 PM \t\t******** REVISOR: anthropic.claude-3-sonnet-20240229-v1:0********\n",
      "05/24/2024 12:15:59 PM \t\t******** SUMMERY: meta.llama3-8b-instruct-v1:0********\n",
      "05/24/2024 12:15:59 PM \tACTOR QUESTION: Current state:Adam:alive,Bella:alive,Charles:alive,Daphne:alive,Ethan:alive,Fiona:alive,Gabriel:alive,Haley:alive.Remember, the player you support is Bella, identity wolf, personality Independent Thinker. Team: 2wolf ,4villager ,1prophet ,1witch . Teammates: Bella,Gabriel.. Please extract useful information, then think through step-by-step. Time: Day 2 discussion phase. How should you act?\n",
      "05/24/2024 12:15:59 PM HTTP Request: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke-with-response-stream \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Observation: It is currently the discussion phase of Day 2. My identity is a werewolf, and my teammate is Gabriel. Daphne has been revived twice, indicating she is likely the witch or has a protective effect. Adam has started a debate, encouraging everyone to share information openly.\n",
      "\n",
      "Reasoning: Since Daphne's identity as the witch or having a protective effect is becoming more apparent, it would be unwise to target her directly for now. Doing so would risk exposing my identity as a werewolf. It is crucial to gather more information during this discussion phase to identify potential villagers or the prophet.\n",
      "\n",
      "Thinking:\n",
      "1) As an independent thinker, I should not blindly follow my teammate Gabriel's suggestions if they seem illogical or reckless.\n",
      "2) However, it is still essential to coordinate with Gabriel to avoid exposing ourselves as werewolves.\n",
      "3) During the discussion, I should carefully observe the behavior and statements of other players, looking for any inconsistencies or suspicious patterns.\n",
      "4) If any player seems to have inside knowledge or exhibits behavior that could indicate they are the prophet, I should subtly cast doubt on their credibility without directly accusing them.\n",
      "5) I should also participate in the discussion to avoid appearing suspicious myself,"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[1], line 6\u001b[0m\n\u001b[1;32m      4\u001b[0m GM \u001b[38;5;241m=\u001b[39m GameMaster(num\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2\u001b[39m, queueSize\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m50\u001b[39m, quick\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[1;32m      5\u001b[0m GM\u001b[38;5;241m.\u001b[39mResetGame(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124men\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m----> 6\u001b[0m \u001b[43mGM\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mRunGame\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m      7\u001b[0m GM\u001b[38;5;241m.\u001b[39mEndGame()\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GameMaster.py:585\u001b[0m, in \u001b[0;36mGameMaster.RunGame\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    583\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39misDay \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m    584\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mPreAction(i)\n\u001b[0;32m--> 585\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDoAction\u001b[49m\u001b[43m(\u001b[49m\u001b[43mi\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    586\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mPostAction(i)\n\u001b[1;32m    587\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mwinner \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GameMaster.py:418\u001b[0m, in \u001b[0;36mGameMaster.DoAction\u001b[0;34m(self, i)\u001b[0m\n\u001b[1;32m    415\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m player\u001b[38;5;241m.\u001b[39mGetStatus() \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m: \n\u001b[1;32m    416\u001b[0m     \u001b[38;5;66;03m#question_template = self.game_config_dict[\"player\"][\"action_plan_day\"]\u001b[39;00m\n\u001b[1;32m    417\u001b[0m     question_template \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mLang(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mplayer.action_plan_day\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m--> 418\u001b[0m     \u001b[43mplayer\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDoPlanning\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion_template\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mi\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    419\u001b[0m     \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[1;32m    420\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GamePlayer.py:157\u001b[0m, in \u001b[0;36mGamePlayer.DoPlanning\u001b[0;34m(self, question_template, idx)\u001b[0m\n\u001b[1;32m    155\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mDoMemory(memories\u001b[38;5;241m=\u001b[39m[])\n\u001b[1;32m    156\u001b[0m question \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mquestion_template\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stateInfoBuilder(), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_playerInfoBuilder(), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39midx)\n\u001b[0;32m--> 157\u001b[0m answer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDoAnswer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    158\u001b[0m answer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mDoValidate(question, answer)\n\u001b[1;32m    159\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mDoAction(answer)\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GamePlayer.py:169\u001b[0m, in \u001b[0;36mGamePlayer.DoAnswer\u001b[0;34m(self, question)\u001b[0m\n\u001b[1;32m    167\u001b[0m     question \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mquestion_template\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stateInfoBuilder(), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_playerInfoBuilder(), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39midx)\n\u001b[1;32m    168\u001b[0m     question \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mGM\u001b[38;5;241m.\u001b[39mLang(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mplayerDoAnswer\u001b[39m\u001b[38;5;124m\"\u001b[39m)\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mreflectScore) \u001b[38;5;241m+\u001b[39m question\n\u001b[0;32m--> 169\u001b[0m answer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_invokeActor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    170\u001b[0m answer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mDoReflect(question, answer)\n\u001b[1;32m    171\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m answer\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GamePlayer.py:134\u001b[0m, in \u001b[0;36mGamePlayer._invokeActor\u001b[0;34m(self, question, reflect)\u001b[0m\n\u001b[1;32m    132\u001b[0m logger\u001b[38;5;241m.\u001b[39minfo(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\t\u001b[39;00m\u001b[38;5;124mACTOR QUESTION: \u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m+\u001b[39m question)\n\u001b[1;32m    133\u001b[0m \u001b[38;5;66;03m#print(_question)\u001b[39;00m\n\u001b[0;32m--> 134\u001b[0m answer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magent\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mactor\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDoAnswer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    135\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m answer\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GameAssistant.py:38\u001b[0m, in \u001b[0;36mGameAssistant.DoAnswer\u001b[0;34m(self, question)\u001b[0m\n\u001b[1;32m     37\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mDoAnswer\u001b[39m(\u001b[38;5;28mself\u001b[39m, question):\n\u001b[0;32m---> 38\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_invoke\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/GameAssistant.py:31\u001b[0m, in \u001b[0;36mGameAssistant._invoke\u001b[0;34m(self, question)\u001b[0m\n\u001b[1;32m     28\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_invoke\u001b[39m(\u001b[38;5;28mself\u001b[39m, question):\n\u001b[1;32m     29\u001b[0m     \u001b[38;5;66;03m# _question = self.template_role.format(input=question)\u001b[39;00m\n\u001b[1;32m     30\u001b[0m     _question\u001b[38;5;241m=\u001b[39m question\n\u001b[0;32m---> 31\u001b[0m     answer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magent\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minvoke\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_question\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     32\u001b[0m     \u001b[38;5;66;03m# self.GM.input_tokens = self.GM.input_tokens + self.token_counter.input_tokens\u001b[39;00m\n\u001b[1;32m     33\u001b[0m     \u001b[38;5;66;03m# self.GM.output_tokens = self.GM.output_tokens + self.token_counter.output_tokens\u001b[39;00m\n\u001b[1;32m     34\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m answer\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/LangchainMini/LangchainMini.py:53\u001b[0m, in \u001b[0;36mLangchainMini.invoke\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m     51\u001b[0m     prompt \u001b[38;5;241m=\u001b[39m LangchainMiniPromptTemplate(prompt)\u001b[38;5;241m.\u001b[39mformat(history\u001b[38;5;241m=\u001b[39mhistory, chat_history\u001b[38;5;241m=\u001b[39mhistory)\n\u001b[1;32m     52\u001b[0m \u001b[38;5;66;03m# logger.info(prompt)\u001b[39;00m\n\u001b[0;32m---> 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mllm\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_invoke\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprompt\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/SageMaker/LLM-Game-Agents/WereWolf/shared/LangchainMini/LangChainMiniClaude.py:75\u001b[0m, in \u001b[0;36mAnthropic3Bedrock._invoke\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m     67\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclient\u001b[38;5;241m.\u001b[39mmessages\u001b[38;5;241m.\u001b[39mstream(\n\u001b[1;32m     68\u001b[0m     model\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmodel_id,\n\u001b[1;32m     69\u001b[0m     max_tokens\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_tokens,\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m     72\u001b[0m     messages\u001b[38;5;241m=\u001b[39mmessages\n\u001b[1;32m     73\u001b[0m ) \u001b[38;5;28;01mas\u001b[39;00m stream:\n\u001b[1;32m     74\u001b[0m     streamtext \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m---> 75\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m text \u001b[38;5;129;01min\u001b[39;00m stream\u001b[38;5;241m.\u001b[39mtext_stream:\n\u001b[1;32m     76\u001b[0m         \u001b[38;5;28mprint\u001b[39m(text, end\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m, flush\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m     77\u001b[0m         streamtext \u001b[38;5;241m=\u001b[39m streamtext \u001b[38;5;241m+\u001b[39m text\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/anthropic/lib/streaming/_messages.py:146\u001b[0m, in \u001b[0;36mMessageStream.__stream_text__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    145\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__stream_text__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[\u001b[38;5;28mstr\u001b[39m]:\n\u001b[0;32m--> 146\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m:\n\u001b[1;32m    147\u001b[0m         \u001b[38;5;28;01mif\u001b[39;00m chunk\u001b[38;5;241m.\u001b[39mtype \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcontent_block_delta\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m chunk\u001b[38;5;241m.\u001b[39mdelta\u001b[38;5;241m.\u001b[39mtype \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtext_delta\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m    148\u001b[0m             \u001b[38;5;28;01myield\u001b[39;00m chunk\u001b[38;5;241m.\u001b[39mdelta\u001b[38;5;241m.\u001b[39mtext\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/anthropic/_streaming.py:45\u001b[0m, in \u001b[0;36mStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     44\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__iter__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[_T]:\n\u001b[0;32m---> 45\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m item \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_iterator:\n\u001b[1;32m     46\u001b[0m         \u001b[38;5;28;01myield\u001b[39;00m item\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/anthropic/lib/streaming/_messages.py:125\u001b[0m, in \u001b[0;36mMessageStream.__stream__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    122\u001b[0m \u001b[38;5;129m@override\u001b[39m\n\u001b[1;32m    123\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__stream__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[MessageStreamEvent]:\n\u001b[1;32m    124\u001b[0m     \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 125\u001b[0m         \u001b[38;5;28;01mfor\u001b[39;00m event \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39m__stream__():\n\u001b[1;32m    126\u001b[0m             \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__events\u001b[38;5;241m.\u001b[39mappend(event)\n\u001b[1;32m    128\u001b[0m             \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__final_message_snapshot \u001b[38;5;241m=\u001b[39m accumulate_event(\n\u001b[1;32m    129\u001b[0m                 event\u001b[38;5;241m=\u001b[39mevent,\n\u001b[1;32m    130\u001b[0m                 current_snapshot\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__final_message_snapshot,\n\u001b[1;32m    131\u001b[0m             )\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/anthropic/_streaming.py:57\u001b[0m, in \u001b[0;36mStream.__stream__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     54\u001b[0m process_data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_client\u001b[38;5;241m.\u001b[39m_process_response_data\n\u001b[1;32m     55\u001b[0m iterator \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_iter_events()\n\u001b[0;32m---> 57\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m sse \u001b[38;5;129;01min\u001b[39;00m iterator:\n\u001b[1;32m     58\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m sse\u001b[38;5;241m.\u001b[39mevent \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcompletion\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m     59\u001b[0m         \u001b[38;5;28;01myield\u001b[39;00m process_data(data\u001b[38;5;241m=\u001b[39msse\u001b[38;5;241m.\u001b[39mjson(), cast_to\u001b[38;5;241m=\u001b[39mcast_to, response\u001b[38;5;241m=\u001b[39mresponse)\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/anthropic/_streaming.py:49\u001b[0m, in \u001b[0;36mStream._iter_events\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     48\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_iter_events\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[ServerSentEvent]:\n\u001b[0;32m---> 49\u001b[0m     \u001b[38;5;28;01myield from\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_decoder\u001b[38;5;241m.\u001b[39miter_bytes(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mresponse\u001b[38;5;241m.\u001b[39miter_bytes())\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/anthropic/lib/bedrock/_stream_decoder.py:35\u001b[0m, in \u001b[0;36mAWSEventStreamDecoder.iter_bytes\u001b[0;34m(self, iterator)\u001b[0m\n\u001b[1;32m     32\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mbotocore\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01meventstream\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m EventStreamBuffer\n\u001b[1;32m     34\u001b[0m event_stream_buffer \u001b[38;5;241m=\u001b[39m EventStreamBuffer()\n\u001b[0;32m---> 35\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m iterator:\n\u001b[1;32m     36\u001b[0m     event_stream_buffer\u001b[38;5;241m.\u001b[39madd_data(chunk)\n\u001b[1;32m     37\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m event \u001b[38;5;129;01min\u001b[39;00m event_stream_buffer:\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpx/_models.py:828\u001b[0m, in \u001b[0;36mResponse.iter_bytes\u001b[0;34m(self, chunk_size)\u001b[0m\n\u001b[1;32m    826\u001b[0m chunker \u001b[38;5;241m=\u001b[39m ByteChunker(chunk_size\u001b[38;5;241m=\u001b[39mchunk_size)\n\u001b[1;32m    827\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m request_context(request\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_request):\n\u001b[0;32m--> 828\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m raw_bytes \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39miter_raw():\n\u001b[1;32m    829\u001b[0m         decoded \u001b[38;5;241m=\u001b[39m decoder\u001b[38;5;241m.\u001b[39mdecode(raw_bytes)\n\u001b[1;32m    830\u001b[0m         \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m chunker\u001b[38;5;241m.\u001b[39mdecode(decoded):\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpx/_models.py:886\u001b[0m, in \u001b[0;36mResponse.iter_raw\u001b[0;34m(self, chunk_size)\u001b[0m\n\u001b[1;32m    883\u001b[0m chunker \u001b[38;5;241m=\u001b[39m ByteChunker(chunk_size\u001b[38;5;241m=\u001b[39mchunk_size)\n\u001b[1;32m    885\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m request_context(request\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_request):\n\u001b[0;32m--> 886\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m raw_stream_bytes \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstream:\n\u001b[1;32m    887\u001b[0m         \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_num_bytes_downloaded \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m(raw_stream_bytes)\n\u001b[1;32m    888\u001b[0m         \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m chunker\u001b[38;5;241m.\u001b[39mdecode(raw_stream_bytes):\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpx/_client.py:123\u001b[0m, in \u001b[0;36mBoundSyncStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    122\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__iter__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m typing\u001b[38;5;241m.\u001b[39mIterator[\u001b[38;5;28mbytes\u001b[39m]:\n\u001b[0;32m--> 123\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stream:\n\u001b[1;32m    124\u001b[0m         \u001b[38;5;28;01myield\u001b[39;00m chunk\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpx/_transports/default.py:110\u001b[0m, in \u001b[0;36mResponseStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    108\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__iter__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m typing\u001b[38;5;241m.\u001b[39mIterator[\u001b[38;5;28mbytes\u001b[39m]:\n\u001b[1;32m    109\u001b[0m     \u001b[38;5;28;01mwith\u001b[39;00m map_httpcore_exceptions():\n\u001b[0;32m--> 110\u001b[0m         \u001b[38;5;28;01mfor\u001b[39;00m part \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_httpcore_stream:\n\u001b[1;32m    111\u001b[0m             \u001b[38;5;28;01myield\u001b[39;00m part\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py:367\u001b[0m, in \u001b[0;36mPoolByteStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    365\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m    366\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclose()\n\u001b[0;32m--> 367\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m exc \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py:363\u001b[0m, in \u001b[0;36mPoolByteStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    361\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__iter__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[\u001b[38;5;28mbytes\u001b[39m]:\n\u001b[1;32m    362\u001b[0m     \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 363\u001b[0m         \u001b[38;5;28;01mfor\u001b[39;00m part \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stream:\n\u001b[1;32m    364\u001b[0m             \u001b[38;5;28;01myield\u001b[39;00m part\n\u001b[1;32m    365\u001b[0m     \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_sync/http11.py:349\u001b[0m, in \u001b[0;36mHTTP11ConnectionByteStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    347\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m ShieldCancellation():\n\u001b[1;32m    348\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclose()\n\u001b[0;32m--> 349\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_sync/http11.py:341\u001b[0m, in \u001b[0;36mHTTP11ConnectionByteStream.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    339\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m    340\u001b[0m     \u001b[38;5;28;01mwith\u001b[39;00m Trace(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mreceive_response_body\u001b[39m\u001b[38;5;124m\"\u001b[39m, logger, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_request, kwargs):\n\u001b[0;32m--> 341\u001b[0m         \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_connection\u001b[38;5;241m.\u001b[39m_receive_response_body(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m    342\u001b[0m             \u001b[38;5;28;01myield\u001b[39;00m chunk\n\u001b[1;32m    343\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m    344\u001b[0m     \u001b[38;5;66;03m# If we get an exception while streaming the response,\u001b[39;00m\n\u001b[1;32m    345\u001b[0m     \u001b[38;5;66;03m# we want to close the response (and possibly the connection)\u001b[39;00m\n\u001b[1;32m    346\u001b[0m     \u001b[38;5;66;03m# before raising that exception.\u001b[39;00m\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_sync/http11.py:210\u001b[0m, in \u001b[0;36mHTTP11Connection._receive_response_body\u001b[0;34m(self, request)\u001b[0m\n\u001b[1;32m    207\u001b[0m timeout \u001b[38;5;241m=\u001b[39m timeouts\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mread\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m    209\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m--> 210\u001b[0m     event \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_receive_event\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    211\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(event, h11\u001b[38;5;241m.\u001b[39mData):\n\u001b[1;32m    212\u001b[0m         \u001b[38;5;28;01myield\u001b[39;00m \u001b[38;5;28mbytes\u001b[39m(event\u001b[38;5;241m.\u001b[39mdata)\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_sync/http11.py:224\u001b[0m, in \u001b[0;36mHTTP11Connection._receive_event\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m    221\u001b[0m     event \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_h11_state\u001b[38;5;241m.\u001b[39mnext_event()\n\u001b[1;32m    223\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m event \u001b[38;5;129;01mis\u001b[39;00m h11\u001b[38;5;241m.\u001b[39mNEED_DATA:\n\u001b[0;32m--> 224\u001b[0m     data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_network_stream\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m    225\u001b[0m \u001b[43m        \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mREAD_NUM_BYTES\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\n\u001b[1;32m    226\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    228\u001b[0m     \u001b[38;5;66;03m# If we feed this case through h11 we'll raise an exception like:\u001b[39;00m\n\u001b[1;32m    229\u001b[0m     \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[1;32m    230\u001b[0m     \u001b[38;5;66;03m#     httpcore.RemoteProtocolError: can't handle event type\u001b[39;00m\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m    234\u001b[0m     \u001b[38;5;66;03m# perspective. Instead we handle this case distinctly and treat\u001b[39;00m\n\u001b[1;32m    235\u001b[0m     \u001b[38;5;66;03m# it as a ConnectError.\u001b[39;00m\n\u001b[1;32m    236\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m data \u001b[38;5;241m==\u001b[39m \u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_h11_state\u001b[38;5;241m.\u001b[39mtheir_state \u001b[38;5;241m==\u001b[39m h11\u001b[38;5;241m.\u001b[39mSEND_RESPONSE:\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/httpcore/_backends/sync.py:126\u001b[0m, in \u001b[0;36mSyncStream.read\u001b[0;34m(self, max_bytes, timeout)\u001b[0m\n\u001b[1;32m    124\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m map_exceptions(exc_map):\n\u001b[1;32m    125\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sock\u001b[38;5;241m.\u001b[39msettimeout(timeout)\n\u001b[0;32m--> 126\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrecv\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmax_bytes\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/ssl.py:1292\u001b[0m, in \u001b[0;36mSSLSocket.recv\u001b[0;34m(self, buflen, flags)\u001b[0m\n\u001b[1;32m   1288\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m flags \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m   1289\u001b[0m         \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m   1290\u001b[0m             \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnon-zero flags not allowed in calls to recv() on \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m\n\u001b[1;32m   1291\u001b[0m             \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m)\n\u001b[0;32m-> 1292\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbuflen\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1293\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m   1294\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39mrecv(buflen, flags)\n",
      "File \u001b[0;32m~/anaconda3/envs/pytorch_p310/lib/python3.10/ssl.py:1165\u001b[0m, in \u001b[0;36mSSLSocket.read\u001b[0;34m(self, len, buffer)\u001b[0m\n\u001b[1;32m   1163\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sslobj\u001b[38;5;241m.\u001b[39mread(\u001b[38;5;28mlen\u001b[39m, buffer)\n\u001b[1;32m   1164\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1165\u001b[0m         \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sslobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1166\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m SSLError \u001b[38;5;28;01mas\u001b[39;00m x:\n\u001b[1;32m   1167\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m x\u001b[38;5;241m.\u001b[39margs[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m==\u001b[39m SSL_ERROR_EOF \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msuppress_ragged_eofs:\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "from shared.GameMaster import GameMaster\n",
    "from shared.PeTemplates import *\n",
    "\n",
    "GM = GameMaster(num=2, queueSize=50, quick=False)\n",
    "GM.ResetGame(\"en\")\n",
    "GM.RunGame()\n",
    "GM.EndGame()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7f3c9aa9-d3ea-439c-828b-e5d920670233",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c045756e-acf9-460f-9cfd-c7e86cb11250",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "conda_pytorch_p310",
   "language": "python",
   "name": "conda_pytorch_p310"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
